//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.eResearch.Subscriber.Interfaces
{
    using System;

    /// <summary>
    /// Implementers of this interface provide code that listens for new messages from
    /// the Blackboard.
    /// </summary>
    public interface INotificationMessageReceiver
    {
        /// <summary>
        /// Occurs when a new blackboard message is received.
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> BlackboardMessageReceived;

        /// <summary>
        /// Starts listening for new messages from the Blackboard and returns the URL
        /// return address where the service is listening.
        /// </summary>
        /// <returns>Address of the notification message receiver.</returns>
        Uri Start();

        /// <summary>
        /// Stops listening for new messages from the Blackboard.
        /// </summary>
        void Stop();
    }
}
